package createModel.factoryModel.factoryMethodModel;

import java.util.Calendar;

/**
 * 2023/12/29
 * <p>
 * ZhangYi
 * Description 复杂工厂模式测试
 */
public class ComplicatedBuildTest {
    public static void main(String[] args) {
        System.out.println("复杂工厂模式测试start");

        TigerFactory tigerFactory = new TigerFactory();
        tigerFactory.getAnimal().eat();

        MouseFactory mouseFactory = new MouseFactory();
        mouseFactory.getAnimal().eat();

        ChickenFactory chickenFactory = new ChickenFactory();
        chickenFactory.getAnimal().eat();

        MonkeyFactory monkeyFactory = new MonkeyFactory();
        monkeyFactory.getAnimal().eat();
        // 如果要增加新的动物，只需要增加一个工厂类即可, 不需要修改原有的代码, 并且不需要修改任何工厂类的实现代码 扩展性特别的好,只不过 factory特别的多,
        System.out.println("==========================");
        System.out.println("复杂工厂模式测试end");
        Calendar instance = Calendar.getInstance();
    }
}
